<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div class="dad">
    <div class="baby">
    </div>
  </div>
  <script>
    // 父节点查找：parentNode属性  返回最近一级的父节点 找不到返回null
    // 语法：子节点.parentNode
    const baby = document.querySelector('.baby')
    console.log(baby)  //返回dom对象
    console.log(baby.parentNode)  //返回dom对象
    console.log(baby.parentNode.parentNode)  //返回dom对象
    console.log(baby.parentNode.parentNode.parentNode)  //返回dom对象
    console.log(baby.parentNode.parentNode.parentNode.parentNode)  //返回dom对象
    console.log(baby.parentNode.parentNode.parentNode.parentNode.parentNode)  //返回dom对象
  </script>
</body>

</html>